﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Microhard.Core.Extensions
{
    public static class DateTimeExtension
    {
        /// <summary>
        /// 将Datetime转换成UnixInt
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static long Tolong(this DateTime value)
        {
            return (Int32)(value.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
        }
    }
}
